import {defineStore} from "pinia"
export const cartCart = defineStore('cart',{
    state(){
        return{
            cartData:[]
        }
    },
    getters: {
        total(state){
            return (state.cartData.reduce((total,item)=>{
                return total += item.price * item.count
            },0)).toFixed(2)
        }
    }
})